<!-- INCLUDE overall_header.html -->

<a name="maincontent"></a>

<!-- IF S_EDIT -->

	<script type="text/javascript" defer="defer">
	// <![CDATA[
	<!-- IF S_ADD_INFO -->
	
			var ads = Array();
			<!-- BEGIN ads -->
				ads['{ads.ADS_IMAGE}'] = Array();
				ads['{ads.ADS_IMAGE}']['title'] = '{ads.TITLE}';
				ads['{ads.ADS_IMAGE}']['url'] = '{ads.URL}';
				ads['{ads.ADS_IMAGE}']['text'] = '{ads.TEXT}';
				ads['{ads.ADS_IMAGE}']['width'] = {ads.WIDTH};
				ads['{ads.ADS_IMAGE}']['height'] = {ads.HEIGHT};
				ads['{ads.ADS_IMAGE}']['order'] = {ads.ORDER};
			<!-- END ads -->

			function update_image(newimage)
			{
				var use_element = ads[newimage];

				document.getElementById('add_image_src').src = '{PHPBB_ROOT_PATH}{IMG_PATH}/' + encodeURI(newimage);
				document.getElementById('add_title').value = use_element['title'];
				document.getElementById('add_url').value = use_element['url'];
				document.getElementById('add_text').value = use_element['text'];
				document.getElementById('add_width').value = use_element['width'];
				document.getElementById('add_height').value = use_element['height'];

				element = document.getElementById('add_order');
				for (var i = 0; i < element.length; i++)
				{
					if (element.options[i].value == use_element['order'])
					{
						document.getElementById('add_order').options.selectedIndex = i;
					}
				}
			}
		
	<!-- ENDIF -->

	function toggle_select(ads, display, select)
	{
		var disp = document.getElementById('order_disp[' + ads + ']');
		var nodisp = document.getElementById('order_no_disp[' + ads + ']');

		disp.disabled = !display;
		nodisp.disabled = display;

		if (display)
		{
			document.getElementById(select).selectedIndex = 0;
			nodisp.className = 'disabled-options';
			disp.className = '';
		}
		else
		{
			document.getElementById(select).selectedIndex = {S_ORDER_LIST_DISPLAY_COUNT};
			disp.className = 'disabled-options';
			nodisp.className = '';
		}
	}
	// ]]>
	</script>

	<a href="{U_BACK}" style="float: {S_CONTENT_FLOW_END};">&laquo; {L_BACK}</a>

	<h1>{L_ACP_EXPRESS_ADS}</h1>
	<p>{L_ACP_EXPRESS_ADS_EXPLAIN}</p>

	<form id="acp_express_ads" method="post" action="{U_ACTION}">

	<fieldset class="tabulated">
	<legend>{L_ACP_EXPRESS_ADS}</legend>

	<table cellspacing="1">
	<thead>
	<tr>
		<th colspan="{COLSPAN}">{L_CONFIG}</th>
	</tr>
	<!-- IF .items or S_ADD_INFO -->
	<tr class="row3">
		<td>{L_ADS_IMAGE_FILE}</td>
		<td>{L_LOCATION}</td>
		<td>{L_ADS_CONTENT}</td>
		<td>{L_WIDTH}</td>
		<td>{L_HEIGHT}</td>
		<td>{L_DISPLAY}</td>
	<!-- IF ID or S_ADD -->
		<td>{L_ORDER}</td>
	<!-- ENDIF -->
	<!-- IF S_ADD -->
		<td>{L_ADD}</td>
	<!-- ENDIF -->
	</tr>
	</thead>
	<tbody>
	<!-- BEGIN items -->
		<!-- IF items.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
	
		<td style="text-align: center;"><img src="{items.IMG_SRC}" alt="" title="" /><input type="hidden" name="image[{items.IMG}]" value="1" /></td>
		<td style="vertical-align: top;">[{items.IMG}]</td>
		<td>
			<label for="title[{items.IMG}]">{L_ADS_TITLE}: <input name="title[{items.IMG}]" type="text" id="title[{items.IMG}]" value="{items.TITLE}" maxlength="255" /></label><br /><br />
			<label for="url[{items.IMG}]">{L_ADS_URL}: <input name="url[{items.IMG}]" type="text" id="url[{items.IMG}]" value="{items.URL}" maxlength="255" /></label><br /><br />
			<label for="text[{items.IMG}]">{L_ADS_TEXT}: <textarea id="text[{items.IMG}]" name="text[{items.IMG}]" rows="5" cols="45">{items.TEXT}</textarea></label>
		</td>
		<td><input class="text post" type="text" size="3" name="width[{items.IMG}]" value="{items.WIDTH}" /></td>
		<td><input class="text post" type="text" size="3" name="height[{items.IMG}]" value="{items.HEIGHT}" /></td>
		<td>
			<input type="checkbox" class="radio" name="display[{items.IMG}]"{items.DISPLAY_CHECKED} onclick="toggle_select('{items.A_IMG}', this.checked, 'order[{items.A_IMG}]');"/>
			<!-- IF items.S_ID -->
				<input type="hidden" name="id[{items.IMG}]" value="{items.ID}" />
			<!-- ENDIF -->
		</td>
		<!-- IF ID or S_ADD -->
			<td><select id="order[{items.IMG}]" name="order[{items.IMG}]">
				<optgroup id="order_disp[{items.IMG}]" label="{L_DISPLAY_ADS}" <!-- IF not items.DISPLAY_CHECKED -->disabled="disabled" class="disabled-options" <!-- ENDIF -->>{S_ORDER_LIST_DISPLAY}</optgroup>
				<optgroup id="order_no_disp[{items.IMG}]" label="{L_DISPLAY_ADS_NO}" <!-- IF items.DISPLAY_CHECKED -->disabled="disabled" class="disabled-options" <!-- ENDIF -->>{S_ORDER_LIST_UNDISPLAY}</optgroup>
			</select></td>
		<!-- ENDIF -->	
		<!-- IF S_ADD -->
			<td><input type="checkbox" class="radio" name="add_img[{items.IMG}]" value="1" /></td>
		<!-- ENDIF -->
		</tr>
	<!-- END items -->
	<!-- IF S_ADD_INFO -->
	<tr>
		<th colspan="{COLSPAN}">{L_ADD_ADS_INFO}</th>
	</tr>
	<tr class="row1">
		<td style="text-align: center;"><select name="add_image" id="add_image" onchange="update_image(this.options[selectedIndex].value);">{S_IMG_OPTIONS}</select></td>
		<td style="vertical-align: top;"><img src="{IMG_SRC}" id="add_image_src" alt="" title="" /></td>
		<td>
			<label for="add_title">{L_ADS_TITLE}: <input name="add_title" type="text" id="add_title" value="{TITLE}" maxlength="255" /></label><br /><br />
			<label for="add_url">{L_ADS_URL}: <input name="add_url" type="text" id="add_url" value="{URL}" maxlength="255" /></label><br /><br />
			<label for="add_text">{L_ADS_TEXT}: <textarea id="add_text" name="add_text" rows="5" cols="45">{TEXT}</textarea></label>
		</td>
		<td><input class="text post" type="text" size="3" name="add_width" id="add_width" value="{WIDTH}" /></td>
		<td><input class="text post" type="text" size="3" name="add_height" id="add_height" value="{HEIGHT}" /></td>
		<td><input type="checkbox" class="radio" name="add_display" checked="checked" onclick="toggle_select('add', this.checked, 'add_order');"/></td>
 		<td><select id="add_order" name="add_order">
				<optgroup id="order_disp[add]" label="{L_DISPLAY_ADS}">{S_ADD_ORDER_LIST_DISPLAY}</optgroup>
				<optgroup id="order_no_disp[add]" label="{L_DISPLAY_ADS_NO}" disabled="disabled" class="disabled-options" >{S_ADD_ORDER_LIST_UNDISPLAY}</optgroup>
			</select></td>
		<td><input type="checkbox" class="radio" name="add_additional_info" value="1" /></td>
	</tr>
	<!-- ENDIF -->
	<!-- ELSE -->
	<tr class="row3">
		<td colspan="{COLSPAN}">{L_NO_ADS}</td>
	</tr>
	<!-- ENDIF -->
	</tbody>
	</table>

	<p class="submit-buttons">
		<input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" />&nbsp;
		<input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" />
	</p>
	{S_FORM_TOKEN}
	</fieldset>
	</form>

<!-- ELSE -->

	<h1>{L_ACP_EXPRESS_ADS}</h1>
	<p>{L_ACP_EXPRESS_ADS_EXPLAIN}</p>

	<!-- IF NOTICE -->
		<div class="successbox">
			<h3>{L_NOTIFY}</h3>
			<p>{NOTICE}</p>
		</div>
	<!-- ENDIF -->

	<form id="acp_express_ads" method="post" action="{U_ACTION}">

	<fieldset class="tabulated">
	<legend>{L_ACP_EXPRESS_ADS}</legend>

	<p class="quick">
		<input class="button2" name="add" type="submit" value="{L_ADS_ADD}" />&nbsp; &nbsp;<input class="button2" type="submit" name="edit" value="{L_ADS_EDIT}" />
	</p>

	<table cellspacing="1">
	<thead>
	<tr>
		<th>{L_ACP_EXPRESS_ADS}</th>
		<th>{L_ADS_CONTENT}</th>
		<th>{L_OPTIONS}</th>
	</tr>
	</thead>
	<tbody>
	<!-- BEGIN items -->
		<!-- IF items.S_SPACER -->
			<tr>
				<td class="row3" colspan="{COLSPAN}" style="text-align: center;">{L_NOT_DISPLAYED}</td>
			</tr>
		<!-- ENDIF -->
		<!-- IF items.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
			<td style="text-align: center;"><img src="{items.IMG_SRC}" width="{items.WIDTH}" height="{items.HEIGHT}" alt="{items.ALT_TEXT}" title="{items.ALT_TEXT}" /></td>
			<td style="text-align: center;"><strong>{items.TITLE} [<abbr title="{L_ADS_CLICKS}">{items.CLICKS}</abbr>]</strong><br /><a href="{items.URL}">{items.URL}</a><br />{items.TEXT}</td>
			<td style="text-align: right; white-space: nowrap;">
				<!-- IF items.S_FIRST_ROW -->{ICON_MOVE_UP_DISABLED}<!-- ELSE --><a href="{items.U_MOVE_UP}">{ICON_MOVE_UP}</a><!-- ENDIF -->&nbsp;
				<!-- IF items.S_LAST_ROW -->{ICON_MOVE_DOWN_DISABLED}<!-- ELSE --><a href="{items.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a><!-- ENDIF -->
				&nbsp;<a href="{items.U_EDIT}">{ICON_EDIT}</a> <a href="{items.U_DELETE}">{ICON_DELETE}</a>
			</td>
		</tr>
	<!-- END items -->
	</tbody>
	</table>

	{S_FORM_TOKEN}
	</fieldset>
	</form>

<!-- ENDIF -->

<!-- INCLUDE overall_footer.html -->